create or replace procedure p_reset_seq
is
	l_val number;
begin
	execute immediate 'select document_docno_seq.nextval from dual '
	into l_val;

	execute immediate 'alter sequence document_docno_seq increment by -' || l_val-1 || ' minvalue 1';
	
	execute immediate 'select document_docno_seq.nextval from dual '
	into l_val;

	execute immediate 'alter sequence document_docno_seq increment by 1 minvalue 0';	

	execute immediate 'select document_docno_seq.nextval from dual '
	into l_val;		
end;
/